package model;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

import org.simpleframework.xml.*;

import utils.DateUtils;

public class Month {
	@ElementList(inline=true)
	private List<Day> dayList;
	
	@Attribute
	private String idM;
	
	public Month() {
	    super();
	}  
	
	public Month(String idM, int idY) throws ParseException{
		this.idM = idM;
		int days = DateUtils.getDaysOfMonth(idM, idY);
		this.dayList = new ArrayList<Day>(days);
		for (int i=0;i<days;i++){
			dayList.add(new Day(i+1));
		}
	}
	
	public Month(List<Day> dayList, String idM) {
	    this.dayList = dayList;
	    this.idM = idM;
	}

	public List<Day> getDay() {
		return dayList;
	}

	public void setDay(List<Day> dayList) {
		this.dayList = dayList;
	}

	public String getIdM() {
		return idM;
	}

	public void setIdM(String idM) {
		this.idM = idM;
	}

	
	
}
